﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using NETDB;

public partial class mis_user_log_detail : BasePermissionPage
{
  protected void Page_Load(object sender, EventArgs e)
  {
    if (!IsPostBack)
    {
      string uid = Request["uid"];
      string uname = Request["uname"];
      string dname = Request["dname"];
      string date = Request["date"];
      lbl_user.Text = string.IsNullOrEmpty(uname) ? string.Empty : uname;
      lbl_dept.Text = string.IsNullOrEmpty(dname) ? string.Empty : dname;
      lbl_YearMonth.Text = string.IsNullOrEmpty(date) ? string.Empty : date;
      lbl_USER_ID.Text = string.IsNullOrEmpty(uid) ? string.Empty : uid; 
      lbl_LOGIN_DATE.Text = string.IsNullOrEmpty(date) ? string.Empty : date.Replace("/", "");
    }
  }
  protected void btn_exit_Click(object sender, EventArgs e)
  {
    Response.Redirect("~/Management/System/mis_user_log.aspx");
  }
  protected void gv_login_log_RowDataBound(object sender, GridViewRowEventArgs e)
  {
    if (e.Row.RowType == DataControlRowType.DataRow)
    {
      Label lbl = e.Row.FindControl("lbl_LOGIN_DATE") as Label;
      lbl.Text = CommonUtil.TransferyyyyMMddToDate(lbl.Text);
    }
  }
  protected void btn_export_Click(object sender, EventArgs e)
  {
    btn_exit.Visible = false;
    btn_export.Visible = false;
    ExportUtil.ExportWebControlToExcel(DateTime.Now.ToString("yyyyMMdd-hhmmss-") + "LoginDetailLog", PanelMain);
  }

  public override void VerifyRenderingInServerForm(Control control)
  {

  }
}